<template>
  <div id='updateFail'>
    <div class="card-container">
      <el-table v-loading="loading" :data="dataLsit">
      <el-table-column label="推送时间" width="180" show-overflow-tooltip align="center" prop="pushTime" />
      <el-table-column label="设备序列号" show-overflow-tooltip align="center" prop="deviceCode" />
      <el-table-column label="站点名称" show-overflow-tooltip align="center" prop="siteName" />
      <el-table-column label="设备类型" show-overflow-tooltip align="center" prop="deviceTypeLabel" />
      <el-table-column label="设备型号" show-overflow-tooltip align="center" prop="model" />
      <el-table-column label="软件版本" show-overflow-tooltip align="center" prop="version" />
      <el-table-column label="推送状态" align="center" prop="pushStatus">
        <template slot-scope="scope">
          <span v-if="scope.row.pushStatus == '1'" style="color: #67C23A;">成功</span>
          <span v-else style="color: #F56C6C;">失败</span>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="onlineStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_on_line_status" :value="scope.row.onlineStatus" />
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />
    </div>
   
  </div>
</template>

<script>
import { getFailLog } from '@/api/rehearsal/index.js';

export default {
  name: 'updateFail',
  dicts: ['sys_on_line_status'],
  props: {
    row: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      loading: true,
      dataLsit: [],
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      total: 0,
    };
  },
  computed: {},
  created() {
    // if (process.client){}
  },
  mounted() {
    this.getList();
  },
  beforeCreate() { },
  beforeMount() { },
  methods: {
    async getList() {
      this.queryParams.drillPushTotalId = this.row.drillPushTotalId
      this.queryParams.pushStatus =  this.row.pushStatus
      const res = await getFailLog(this.queryParams);
      if (res.code == 200) {
        this.dataLsit = res.rows;
        this.total = res.total;
        this.loading = false;
      }
    },
  },
};
</script>
<style lang='scss' scoped>
#updateFail {
  width: 100%;
  height: 100%;
}
</style>